<?php foreach ($css as $cs): ?>
<?php use_stylesheet($cs->getCss()) ?>
<?php endforeach ?>

<?php use_stylesheet('page.css') ?>
<h1 align="center">Résultat</h1>
<table align="center">
  <thead>
    <tr>
      <th>Nom du groupe</th>
      <th>Description</th>
      <th>Membre(s)</th>
    </tr>
  </thead>
  <tbody>
    <?php foreach ($pager->getResults() as $sf_guard_group): ?>
    <tr>
      <td><?php echo $sf_guard_group->getName() ?></td>
      <td><?php echo $sf_guard_group->getDescription() ?></td>
      <td><?php echo $sf_guard_group->getNombreMembre() ?></td>
      <td>
        <?php if($sf_guard_group->getMembreOuPas($user) == 0): ?>
         <?php echo link_to('rejoindre le groupe ?','recherche/create?id_groupe='.$sf_guard_group->getId().'')?>
        <?php else : echo "déjà membre de ce groupe !" ?>
        <?php endif ?>
      </td>
    </tr>
    <?php endforeach; ?>
  </tbody>
</table>
<?php if ($pager->haveToPaginate()): ?>
  <?php echo link_to('&laquo;', 'recherche/recherche?page='.$pager->getFirstPage().'') ?>
  <?php echo link_to('&lt;', 'recherche/recherche?page='.$pager->getPreviousPage().'') ?>
  <?php $links = $pager->getLinks(); foreach ($links as $page): ?>
    <?php echo ($page == $pager->getPage()) ? $page : link_to($page, 'recherche/recherche?page='.$page.'')?>
    <?php if ($page != $pager->getCurrentMaxLink()): ?> - <?php endif ?>
  <?php endforeach ?>
  <?php echo link_to('&gt;', 'recherche/recherche?page='.$pager->getNextPage().'') ?>
  <?php echo link_to('&raquo;', 'recherche/recherche?page='.$pager->getLastPage().'') ?>
   <?php endif ?>
   <br><br>
   <?php echo link_to('retour', 'recherche/index') ?>